package com.js.springbootmongodb.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(collection = "comment")
public class Comment {
    @Id
    private String id;
    @Indexed
    @Field(value = "articleid")
    private String articleid;
    @Indexed
    @Field(value = "content")
    private String content;
    @Indexed
    @Field(value = "userid")
    private String userid;
    @Indexed
    @Field(value = "nickname")
    private String nickname;
    @Indexed
    @Field(value = "createdatetime")
    private String createdatetime;
    @Indexed
    @Field(value = "likenum")
    private Integer likenum;
    @Indexed
    @Field(value = "state")
    private Integer state;
}
